<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.prime.com.tr/ui"
      xmlns:c="http://java.sun.com/jsp/jstl/core">

    <body>

        <ui:composition>

            <div id="post">


                <h3>Suas Questões</h3>


                    <ui:repeat value="#{QuestaoController.questaos}" var="questaoTemp" varStatus="status">
                      
                        <div id="stylized" class="questao" style="border-bottom: solid 1px; display: block">

                            <div class="enunciado">
                                <h:outputText value="${status.count}" />
                                <h:outputText value=" - " />
                                <h:outputText value="#{questaoTemp.autor}" />
                                <h:outputText value=" - " />
                                <h:outputText value="#{questaoTemp.enunciado}" />
                                <br />
                            </div>
                            <div class="textoAjuda">
                                <h:outputText value="#{questaoTemp.textoAjuda}" />
                                <br />
                            </div>
                            <div class="itens">

                                <!--Para multipla Escolha-->
                                <h:panelGroup styleClass="itens" rendered="#{questaoTemp.tipoQuestao.multiplaEscolha}">

                                    <c:forEach items="#{questaoTemp.items}" var="itemTemp" >
                                        <div style="display: block" >
                                            <h:outputText value="(x) - " rendered="#{itemTemp.verdadeiro}" />
                                            <h:outputText value="( ) - " rendered="#{!itemTemp.verdadeiro}" />
                                            <h:outputText value="#{itemTemp.descricao}" />
                                        </div>
                                    </c:forEach>
                                </h:panelGroup>

                                <!--Para multipla Seleção-->
                                <h:panelGroup styleClass="itens" rendered="#{questaoTemp.tipoQuestao.multiplaSelecao}">

                                    <c:forEach items="#{questaoTemp.items}" var="itemTemp" >

                                        <div style="display: block" >
                                            <h:outputText value="[x] - " rendered="#{itemTemp.verdadeiro}" />
                                            <h:outputText value="[ ] - " rendered="#{!itemTemp.verdadeiro}" />
                                            <h:outputText value="#{itemTemp.descricao}" />
                                        </div>
                                    </c:forEach>
                                </h:panelGroup>

                                <!--Para verdadeiro ou falco-->
                                <h:panelGroup styleClass="itens" rendered="#{questaoTemp.tipoQuestao.verdadeiroOuFalso}">

                                    <c:forEach items="#{questaoTemp.items}" var="itemTemp" >
                                        <div style="display: block" >
                                            <h:outputText value="(V) - " rendered="#{itemTemp.verdadeiro}" />
                                            <h:outputText value="(F) - " rendered="#{!itemTemp.verdadeiro}" />
                                            <h:outputText value="#{itemTemp.descricao}" />
                                        </div>
                                    </c:forEach>
                                </h:panelGroup>

                                <!--para Descritiva-->
                                <h:panelGroup styleClass="itens" rendered="#{questaoTemp.tipoQuestao.descritiva}">

                                    <c:forEach items="#{questaoTemp.items}" var="itemTemp" >

                                        <div style="display: block">
                                            <h:outputText value="Opção de Resposta" style="color: gray; font-size: 0.6em" />
                                            <br />
                                            <h:outputText value="#{itemTemp.descricao}" />
                                            <br />
                                        </div>
                                    </c:forEach>
                                </h:panelGroup>
                            </div>
                            <h:commandLink value="add" action="#{QuestaoController.addQuestao}" />
                            <h:outputText value=" - " />
                            <h:commandLink value="ver" action="#{QuestaoController.load}" />



                        </div>

                    </ui:repeat>



            </div>
        </ui:composition>


    </body>
</html>
